package com.lfp.consumer;

import com.lfp.config.rabbitmq.BackupExchangeQueueConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Description 备份交换机 消费者
 * @Author lfp
 * @Date 2022/7/19
 * @Version 1.0
 */
@Slf4j
@Component
public class BackupExchangeConsumer {

    //监听 主队列消息
    @RabbitListener(queues = BackupExchangeQueueConfig.MASTER_QUEUE_NAME)
    public void receiveMasterExchangeMessage(String message){
        log.info("接收到主队列消息：{}",message);
    }


    //监听预警队列消息
    @RabbitListener(queues = BackupExchangeQueueConfig.BACKUP_QUEUE_NAME)
    public void receiveBackupQueueMessage(String message){
        log.info("接收到备份队列消息：{}",message);
    }


    //监听预警队列消息
    @RabbitListener(queues = BackupExchangeQueueConfig.WARNING_QUEUE_NAME)
    public void receiveWarningQueueMessage(String message){
        log.info("接收到预警队列消息：{}",message);
    }
}
